package _22define.test;

import java.io.*;

public class work3 {
    public static void main(String[] args) throws IOException {
        FileInputStream in=new FileInputStream("src/note/a.txt");
        byte[] bytes=new byte[1024];
        int readCount=in.read(bytes);
        String num=new String(bytes,0,readCount);
        System.out.println(num);
        int count1=0;
        int count2=0;
        for (int i = 0; i <num.length(); i++) {
            if (num.charAt(i)%2==0){
                count1++;
            }else count2++;
        }
        System.out.println(count1);
        System.out.println(count2);
        BufferedOutputStream out=new BufferedOutputStream(new FileOutputStream(new File("src/note/a.txt"),true));
        String nums=num+(count1)+(count2);
        System.out.println(nums);
        out.write(nums.getBytes());
        out.flush();
        out.close();
    }
}
